<template>
  <div class="mt-1">父弹窗</div>
  <el-button type="primary" @click="openDialog">打开dialog </el-button>
</template>

<script setup lang="ts">
import { shallowRef } from "vue"
import { addDialog } from "@/components/gDialog/index"
import TestDialog from "./modal/index.vue"
const openDialog = () => {
  addDialog({
    title: "我是dialog",
    width: "500px",
    props: {
      id: 0
    },
    component: shallowRef(TestDialog),
    callBack: (data: any) => {
      //当弹窗任务结束后，调用父页面的回掉函数。（比如我新增完成了需要刷新列表页面）
      console.log("回调函数", data)
    }
  })
}
</script>

<style></style>
